package org.vigor.lab.gateway.config;

import com.ecwid.consul.v1.ConsulClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * DevConfig
 * <p></p>
 *
 * @author Vigor Yuan
 */
@Configuration
@ConditionalOnProperty(prefix = "spring.profiles",name = "active",havingValue = "dev")
public class DevConfig {

    @Autowired
    SysConfig sysConfig;

    @Bean
    public ConsulClient consulClient(){
        return new ConsulClient(sysConfig.getConsulHost());
    }
}
